How to select DOORS attribute by reference attribute

I have database of doors requirements in a module.

There are 2 attribute for each requirement. when i select first attribute value as 'A', then second attribute value '1' should automatically get updated with that reference. 

Similarly for B->2,C->3

 

Can you please help in writing DXL Script to get this customization done in DOORS ?

 

Vijay


vijayamrut - Mon Feb 16 01:26:00 EST 2015

Re: How to select DOORS attribute by reference attribute
GregM_dxler - Tue Feb 17 14:12:45 EST 2015

Hello,

The easiest way is to make the second attribute a layout dxl that is based on the first one.  Here is some code that might help

const string atb1[] = {"A","B","C"}
const string atb2[] = {"1","2","3"}
 
Buffer outbuf = create
Buffer inbuf = create
int j
 
//****Main Program****//
inbuf = obj.atb1 //fetch attribute data
//loop through array looking for value
for (j=0;j<sizeof(atb1);j++) {
   if ((contains(inbuf, atb1[j], 0)) >= 0){
      outbuf += atb2[j]
   }
}  
//display the data
display tempStringOf(outbuf)
//cleanup
delete outbuf

delete prgbuf

Hope this helps,

Greg